<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>紫色鹭</title>
    <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no'
          name='viewport'/>
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <link rel="stylesheet"
          href="https://fonts.googleapis.com/css?family=Nunito:200,200i,300,300i,400,400i,600,600i,700,700i,800,800i,900,900i">
    <link rel="stylesheet" href="assets/css/ready.css">
    <link rel="stylesheet" href="assets/css/demo.css">
    <link rel="stylesheet" href="css/common.css">
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/style-zj.css">
</head>
<body>
<div class="wrapper" id="app">
    <div class="main-header">
        <div class="logo-header">
            <a href="index.html" class="logo">
                紫色鹭后台管理
            </a>
            <button class="navbar-toggler sidenav-toggler ml-auto" type="button" data-toggle="collapse"
                    data-target="collapse" aria-controls="sidebar" aria-expanded="false" aria-label="Toggle navigation">
                <span class="navbar-toggler-icon"></span>
            </button>
            <button class="topbar-toggler more"><i class="la la-ellipsis-v"></i></button>
        </div>
        <nav class="navbar navbar-header navbar-expand-lg">
            <div class="container-fluid">
                <ul class="navbar-nav topbar-nav ml-md-auto align-items-center">
                    <li class="nav-item dropdown">
                        <a class="dropdown-toggle profile-pic" data-toggle="dropdown" href="#" aria-expanded="false">
                            <img src="assets/img/profile.jpg" alt="user-img" width="36"
                                 class="img-circle"><span id="username"></span></span> </a>
                        <ul class="dropdown-menu dropdown-user">
                            <li>
                                <a class="dropdown-item loginOut" href="#"><i class="fa fa-power-off"></i>退出登录</a>
                        </ul>
                        <!-- /.dropdown-user -->
                    </li>
                </ul>
            </div>
        </nav>
    </div>
    <div class="sidebar">
        <div class="scrollbar-inner sidebar-wrapper">
            <ul class="nav">
                <li class="nav-item">
                    <a href="index.html">
                        <i class="la la-dashboard"></i>
                        <p>首页轮播管理</p>
                    </a>
                </li>
                <li class="nav-item">
                    <a href="user-admin.html">
                        <i class="la la-table"></i>
                        <p>用户管理</p>
                    </a>
                </li>
                <li class="nav-item">
                    <a href="class.html">
                        <i class="la la-keyboard-o"></i>
                        <p>商品分类管理</p>
                    </a>
                </li>
                <li class="nav-item">
                    <a href="admin_brand.html">
                        <i class="la la-th"></i>
                        <p>入驻品牌管理</p>
                    </a>
                </li>
                <li class="nav-item">
                    <a href="store-pass.html">
                        <i class="la la-bell"></i>
                        <p>店铺审核管理</p>
                    </a>
                </li>
                <li class="nav-item active">
                    <a href="brand-pass.html">
                        <i class="la la-bell"></i>
                        <p>品牌审核管理</p>
                    </a>
                </li>
                <!--<li class="nav-item">-->
                <!--<a href="typography.html">-->
                <!--<i class="la la-font"></i>-->
                <!--<p>Typography</p>-->
                <!--</a>-->
                <!--</li>-->
                <!--<li class="nav-item">-->
                <!--<a href="icons.html">-->
                <!--<i class="la la-fonticons"></i>-->
                <!--<p>Icons</p>-->
                <!--</a>-->
                <!--</li>-->
            </ul>

        </div>
    </div>
    <div class="main-panel">
        <div class="content">
            <div class="container-fluid">
                <!--<h4 class="page-title">首页轮播管理</h4>-->
                <div class="card">
                    <div class="card-header">
                        <div class="card-title">品牌审核管理 </div>
                    </div>
                    <div class="card-body">
                        <table class="table table-bordered">
                            <thead>
                            <tr>
                                <th scope="col">品牌</th>
                                <th scope="col">公司</th>
                                <th scope="col">描述</th>
                                <th scope="col">时间</th>
                                <th scope="col">状态</th>
                                <th scope="col">操作</th>
                            </tr>
                            </thead>
                            <tbody>
                            <tr v-for="item in list">
                                <td>{{item.zslOrigin.name}}</td>
                                <td>{{item.sysUser.storeName}}</td>
                                <td>{{item.describe}}</td>
                                <td>{{item.crtTime}}</td>
                                <td>{{item.state==2?"审核成功":item.state==3?"审核失败":"待审核"}}</td>
                                <td>
                                    <button class="btn btn-success block"  @click="openModel(item.id,item.zslOrigin.name,item.sysUser.storeName,item.sysUser.username,item.sysUser.phone,item.describe,item.crtTime,item.imgUrl)" data-toggle="modal" data-target="#modalUpdate">查看认证详情</button>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                        <div id="page1"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="modal fade" id="modalUpdate" tabindex="-1" role="dialog" aria-labelledby="modalUpdatePro" style="display: none;" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
            <div class="modal-content">
                <div class="modal-header bg-primary">
                    <h6 class="modal-title">查看认证详情</h6>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">×</span>
                    </button>
                </div>
                <div class="modal-body text-center">
                    <table class="table table-head-bg-success">
                        <tr>
                            <td>企业名称</td>
                            <td>{{name}}</td>
                        </tr>
                        <tr>
                            <td>联系人</td>
                            <td>{{info.contacts}}</td>
                        </tr>
                        <tr>
                            <td>品牌</td>
                            <td>{{info.brandName}}</td>
                        </tr>
                        <tr>
                            <td>手机号</td>
                            <td>{{info.phone}}</td>
                        </tr>
                        <tr>
                            <td>描述</td>
                            <td>{{info.eMail}}</td>
                        </tr>
                        <tr>
                            <td>申请时间</td>
                            <td>{{info.creatTime}}</td>
                        </tr>
                        <tr>
                            <td>品牌图片</td>
                            <td>
                                <img :src="imgBaseUrl + item" alt="" v-for="item in info.brandPic" class="pic">
                            </td>
                        </tr>
                    </table>
                </div>
                <div class="modal-footer">
                    <button type="button" @click="toDo(info.id,2)" class="btn btn-danger sure" data-dismiss="modal">审核失败</button>
                    <button type="button" @click="toDo(info.id,1)" class="btn btn-primary sure" data-dismiss="modal">审核成功</button>
                </div>
            </div>
        </div>
    </div>
</div>
<!-- Modal -->
</body>
<script src="assets/js/core/jquery.3.2.1.min.js"></script>
<script src="assets/js/plugin/jquery-ui-1.12.1.custom/jquery-ui.min.js"></script>
<script src="assets/js/core/popper.min.js"></script>
<script src="assets/js/core/bootstrap.min.js"></script>
<script src="assets/js/plugin/bootstrap-notify/bootstrap-notify.min.js"></script>
<script src="assets/js/plugin/bootstrap-toggle/bootstrap-toggle.min.js"></script>
<script src="assets/js/plugin/jquery-mapael/jquery.mapael.min.js"></script>
<script src="assets/js/plugin/jquery-mapael/maps/world_countries.min.js"></script>
<script src="assets/js/plugin/chart-circle/circles.min.js"></script>
<script src="assets/js/plugin/jquery-scrollbar/jquery.scrollbar.min.js"></script>
<script src="js/config.js"></script>
<script type="text/javascript">
    var Token = localStorage.getItem("Token");
    var limit = 10;
    var offset = 1;
    var count;
    var app = new Vue({
        el: '#app',
        data: {
            list: [],
            imgBaseUrl: imgBaseUrl,
            info: {},
            name:'',
        },
        beforeCreate: function () {
            var that = this;
//            initPage();
        },
        methods: {
            openModel: function (id,brandName,storeName,username,phone,describe,creatTime,brandPic) {
                console.log(storeName);
                var that = this;
                that.name = storeName
                that.info.id = id;
                that.info.brandName = brandName;
                that.info.name = storeName;
                that.info.contacts= username;
                that.info.mobile= phone;
                that.info.phone= phone;
                that.info.eMail= describe;
                that.info.creatTime= creatTime;
                that.info.brandPic = brandPic.split(',')
                $(".add_model").show();
                $(".main").hide();
            },
            toDo: function (id, state) {
                get_ajax("/originAuthorization/audit", {id: id, status: state}, function (data) {
                    layer.msg("审核完成！")
                    initPage();
                });
            },
        },
        updated: function () {

        }

    });
    //获取分页
    function initPage() {
        get_ajax("/originAuthorization/getAuditPage", {
            limit: limit,
            offset: offset,
        }, function (data) {
            app.list = data;
        })
    }
    get_ajaxPage("/originAuthorization/getAuditPage", {
        limit: limit,
        offset: offset,
    }, function (data) {
        app.list = data.data;
        count = data.count;
        layui.use(['layer','laypage'], function () {
            var laypage = layui.laypage;
            laypage.render({
                elem: 'page1',
                count: count,
                limit: limit,
                jump:function (obj, first) {
                    if(!first){
                        offset = obj.curr;
                        initPage();
                    }
                }
            });
        })
    })


</script>
</html>